package com.jokul.web.picture;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.jokul.model.Album;
import com.jokul.service.AlbumService;
import com.jokul.service.AlbumServiceImpl;

/**
 *
 *跳转到上传页面
 *@author jokul
 *@2013-4-8 
 *@下午9:16:38
 */
@WebServlet("/upload_view.do")
public class UploadView extends HttpServlet {

	private static final long serialVersionUID = 1L;

	private AlbumService albumService = new AlbumServiceImpl();
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		HttpSession session = request.getSession();
		Integer userId = (Integer) session.getAttribute("userId");
		List<Album> albums = albumService.getAllAlbum(userId);
		request.setAttribute("albums", albums);
		request.getRequestDispatcher("/pages/picture/upload_view.jsp").forward(request, response);
	}
}
